import request from '@/utils/request'

export function login(username, password, code, key) {
  return request({
    url: '/login',
    method: 'post',
    data: {
      username,
      password,
      code,
      key
    },
    msg: true
  })
}

export function getInfo() {
  return request({
    url: 'user/info',
    method: 'get'
  })
}

export function getCodeImg() {
  return request({
    url: 'captcha',
    method: 'get'
  })
}

export function getCode() {
  return request({
    url: 'captcha',
    method: 'get'
  })
}

export function getLogo() {
  return request({
    url: 'logo/login',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}
